<%@ page pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>
    <title>My JSP 'studentadd.jsp' starting page</title>

    <meta content="no-cache" http-equiv="pragma">
    <meta content="no-cache" http-equiv="cache-control">
    <meta content="0" http-equiv="expires">
    <meta content="keyword1,keyword2,keyword3" http-equiv="keywords">
    <meta content="This is my page" http-equiv="description">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script type="application/javascript">
        function a() {
            var flag = false;
            var c_id = document.getElementById("c_id").value;
            var c_name = document.getElementById("c_name").value;
            var c_time = document.getElementById("c_time").value;
            if (c_id == "") {
                alert("课程编号不能为空");
            } else if (c_name === "") {
                alert("课程名称不能为空");
            } else if (c_time === "") {
                alert("开课时间不能为空");
            } else {
                flag = true;
            }
            return flag;
        }
    </script>
</head>

<body>
<div>课程新增</div>
<span>${CourseRepeat}</span>
<form action="${ctx}/AdminCoursesAddAction">
    <table>
        <tr>
            <td>课程编号</td>
            <td><input name="c_id" id="c_id" type="text"></td>
        </tr>
        <tr>
            <td>课程名称</td>
            <td><input name="c_name" id="c_name" type="text"></td>
        </tr>
        <tr>
            <td>开课时间</td>
            <td><input name="c_time" id="c_time" type="text"></td>
        </tr>
        <tr>
            <td>授课教师</td>
            <td>
                <select name="c_teacher_id">
                    <c:forEach items="${lstv}" var="lstt">
                    <option value="${lstt[0]}">${lstt[1]}</option>
                    </c:forEach>
            </td>
        </tr>
        <%--        <tr>--%>
        <%--            <td>是否可选</td>--%>
        <%--            <td><input name="c_isable" type="text"></td>--%>
        <%--        </tr>--%>
        <tr>
            <td><input name="button3" type="submit" value="添加" onclick="return a()"></td>
        </tr>
    </table>
</form>
<a href="admin/adminmain.jsp">返回主页</a>
</body>
</html>
